import 'package:flutter_ahj_app/base/values/SQColor.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';

class ToastUtils{


  static showToast(String message){

    Fluttertoast.cancel();

        Fluttertoast.showToast(
            msg: message,
            toastLength: Toast.LENGTH_SHORT,
            gravity: ToastGravity.BOTTOM,
            backgroundColor: SQColor.darkGray,
            textColor: SQColor.white,
            fontSize: 14.0
        );
 }


  static showTimeToast(String message){

    Fluttertoast.cancel();

    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM,
      backgroundColor: SQColor.darkGray,
      textColor: SQColor.white,
      fontSize: 14.0,
      timeInSecForIosWeb: 5,
    );

  }

  static showLoading() {
    EasyLoading.instance.indicatorType = EasyLoadingIndicatorType.ring;
    EasyLoading.instance.maskType = EasyLoadingMaskType.black;
    EasyLoading.show();
  }

  static dissLoading() {
    EasyLoading.dismiss();
  }
}